package com.mobile.util.web;

import java.util.Collections;
import java.util.List;

import com.mobile.util.sql.Page;

public class Retorno {
	private List<? extends Object> rows;
	private boolean success = true;
	private int total;

	public Retorno(){
		super();
	}
	
	public Retorno(List<? extends Object> rows) {
		super();
		this.rows = rows;
	}
	
	public Retorno(Page<?> page) {
		super();
		this.rows = page.getPageItems();
		this.total = page.getTotalRows();
	}
	
	public Retorno(Object obj){
		super();
		this.rows = Collections.singletonList(obj);
	}
	
	public List<? extends Object> getRows() {
		return rows;
	}
	public void setRows(List<? extends Object> rows) {
		this.rows = rows;
	}
	public boolean isSuccess() {
		return success;
	}
	public void setSuccess(boolean success) {
		this.success = success;
	}

	public int getTotal() {
		return total;
	}

	public void setTotal(int total) {
		this.total = total;
	}

	
	
	

}
